<template>
  <div>
    <!-- 产品 -->
    <Product v-if="value == 0">
    </Product>
    <!-- 我的 -->
    <Mine v-if="value == 1" :isUpdate="isUpdate">
    </Mine>
    <u-tabbar
      :value="value"
      @change="name => value = name"
      :fixed="true"
      :placeholder="true"
      :safeAreaInsetBottom="true">
      <u-tabbar-item text="首页"  icon="home" ></u-tabbar-item>
      <u-tabbar-item text="我的" icon="account" ></u-tabbar-item>
      </u-tabbar>
  </div>
</template>
<script>
import Product from './product/Product.vue'
import LoanList from "./product/LoanList"
import Mine from '../mine/Mine.vue'
export default {
  components: {
    Product, Mine, LoanList
  },
  data () {
    return {
      value: 0,
      componentKey: 0,
      isUpdate: false,
    }
  },
  
  onLoad(option) {
    if(option.value) {
      this.value = +option.value
    }
  },
  methods: {

  },
  onShow() {
    this.isUpdate = !this.isUpdate
    console.log('onLoad')
  }
}
</script>

<style lang="scss" scoped>
</style>